package two;
/**
 * @Author:DarknessShadow
 * @description:多线程单例模式，线程不安全
 * @date 2020/5/12 10:23
 */
public class Singleton {
    private static Singleton singleton = null;
    private Singleton(){
        System.out.println("singleton实例化了.......");
        slowdown();
    }
    public static Singleton getInstance(){
        if (singleton == null) {
            singleton = new Singleton();
        }
        return singleton;
    }
    private void slowdown(){
        try {
            Thread.sleep(1000);
        } catch (Exception e) {
        }
    }
}
